package classexercise;

public class Rectangle extends Shape {
	private double width = 1.0;
	private double length = 1.0;

	public Rectangle() {
	}

	public Rectangle(double width, double length) {
		this.width = width;
		this.length = length;
	}

	public Rectangle(double width, double length, String color, boolean filled) {
		super(color, filled);
		this.width = width;
		this.length = length;

	}

	

	public double getWidth() {
		return width;
	}

	public void setWidth(double width) {
		this.width = width;
	}

	public double getLength() {
		return length;
	}

	public void setLength(double length) {
		this.length = length;
	}
	
	public double getArea(){
		  double area=width*length;
		  return area;
	}
	public double getPerimeter(){
		  double perimeter=(width+length)*2;
		  return perimeter;
	}
	public String toString() {
		return "Rectangle [width=" + width + ", length=" + length + "]";
	}

	

}
